package com.rabbiter.oes.serviceimpl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rabbiter.oes.entity.JudgeQuestion;
import com.rabbiter.oes.entity.MultiQuestion;
import com.rabbiter.oes.mapper.JudgeQuestionMapper;
import com.rabbiter.oes.service.JudgeQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;


@Service
public class JudgeQuestionServiceImpl implements JudgeQuestionService {

    @Autowired
    private JudgeQuestionMapper judgeQuestionMapper;

    @Override
    public List<JudgeQuestion> findByIdAndType(String paperId) {
        return judgeQuestionMapper.findByIdAndType(paperId);
    }

    @Override
    public IPage<JudgeQuestion> findAll(Page<JudgeQuestion> page) {
        return judgeQuestionMapper.findAll(page);
    }

    @Override
    public JudgeQuestion findOnlyQuestionId() {
        return judgeQuestionMapper.findOnlyQuestionId();
    }

    @Override
    public int add(JudgeQuestion judgeQuestion) {
        return judgeQuestionMapper.add(judgeQuestion);
    }

    @Override
    public List<Integer> findBySubject(String subject, Integer pageNo) {
        return judgeQuestionMapper.findBySubject(subject,pageNo);
    }

    @Override
    public int edit(JudgeQuestion judgeQuestion) {
        return judgeQuestionMapper.edit(judgeQuestion);
    }

    @Override
    public boolean saveBatch(Collection<MultiQuestion> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdateBatch(Collection<MultiQuestion> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean updateBatchById(Collection<MultiQuestion> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdate(MultiQuestion entity) {
        return false;
    }

    @Override
    public MultiQuestion getOne(Wrapper<MultiQuestion> queryWrapper, boolean throwEx) {
        return null;
    }

    @Override
    public Map<String, Object> getMap(Wrapper<MultiQuestion> queryWrapper) {
        return null;
    }

    @Override
    public <V> V getObj(Wrapper<MultiQuestion> queryWrapper, Function<? super Object, V> mapper) {
        return null;
    }

    @Override
    public BaseMapper<MultiQuestion> getBaseMapper() {
        return null;
    }

    @Override
    public Class<MultiQuestion> getEntityClass() {
        return null;
    }

    @Override
    public List<JudgeQuestion> findRandom(Integer count ,String subject) {
        return judgeQuestionMapper.findRandom( count,subject);
    }
    @Override
    public List<JudgeQuestion> findSequence(String subject) {
        return judgeQuestionMapper.findSequence(subject);
    }

    public List<JudgeQuestion> findByExamCodeAndUserId(String PaperId, Long userId) {
        return judgeQuestionMapper.findByExamCodeAndUserId(PaperId, userId);
    }
}
